package com.qingke.hibernate.bean;

import java.sql.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name="register")
//@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
public class Register {
	@Id
	@Column(name="id")
	private int id;
	@Column(name="create_time")
	private Date createTime;
	
	@OneToOne
	@JoinColumn(name="student_id")
	private Student student;
	
	@ManyToOne
	@JoinColumn(name="school_year_id")
	private SchoolYear schoolYear;
	
	@ManyToOne
	@JoinColumn(name="major_id")
	private Major major;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Student getStudent() {
		return student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	public SchoolYear getSchoolYear() {
		return schoolYear;
	}

	public void setSchoolYear(SchoolYear schoolYear) {
		this.schoolYear = schoolYear;
	}

	public Major getMajor() {
		return major;
	}

	public void setMajor(Major major) {
		this.major = major;
	}

	@Override
	public String toString() {
		return "Register [id=" + id + ", createTime=" + createTime + ", student=" + student + ", schoolYear="
				+ schoolYear + ", major=" + major + "]";
	}
	
	
}
